package cn.dakaqi.vo.request.openPlatform;

import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;

/**
 * @author beliveli on 2016/7/18/0018
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class MaibaoVo {

    private String customerCode;
    private String groupCode = "GV0000006056";
    private String maibaoMemberCode = "402882f655591a000155591bf46f0001";

    //创建用户需要参数
    private String mobile; //需要输入 用户手机号
    private String password = "1";
    private int platform = 1;
    private String area;
    private Double lng = 1.0;
    private Double lat = 1.0;
    private String code;

    //创建活动&加入活动
    private String memberCode;
    private String activityCode;
    private int role;
    private String skill;
    private int scope = -1;
    private int needs = 0;
    private String activityName; //需要输入 活动名称
    private String demo;
    private String imgs;
    private int type = 1;
    private String startTime;
    private String endTime;
    private String address = "上海";
    private String tags;
    private String weekDay;
    private String province ="上海市";
    private String city = "上海市";
    private String district = "";
//    private Double lng;
//    private Double lat;
    private String monitorMemberCode;
    private String crateUseMemberCode;
//    private String groupCode;

    //保险
    private String sn;// '流水号',
//    private String memberCode;//会员编号
    private String volunteerCode;//'志愿者编号',
    private String name;//'姓名',                    //需要输入
//    private String mobile;//'手机号码',
    private String idCard;//'身份证',               //需要输入
    private String guardianName;//'监护人姓名',      //需要输入
    private String guardianMobile;//'监护人电话',    //需要输入
    private String guardianIDCard;//'监护人身份证',  //需要输入
    private String cardNum;//'银行卡号',
    private Date createTime;//'记录时间',
//    private String platform;//'平台编号',
    private int status;//'是否激活 0未 1已',
    private String activateSn;//'激活流水号',
    private Date activateTime;//'记录时间',

    public static MaibaoVo build(String jsonParam){
        JSONObject jsonObject = JSONObject.parseObject(jsonParam);
        MaibaoVo maibaoVo = new MaibaoVo();
        maibaoVo.setCustomerCode(jsonObject.get("customerCode").toString());
        maibaoVo.setMobile(jsonObject.get("mobile").toString());
        maibaoVo.setActivityName(jsonObject.get("activityName").toString());
        maibaoVo.setName(jsonObject.get("name").toString());
        maibaoVo.setIdCard(jsonObject.get("idCard").toString());
        maibaoVo.setStartTime(jsonObject.get("startTime").toString());
        maibaoVo.setEndTime(jsonObject.get("endTime").toString());

        return maibaoVo;
    }
}
